package org.codert.jpa.servletcomponent;

import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-09-24 17:48
 **/
@WebServlet(urlPatterns = "/servlet")
public class MyServlet implements Servlet {
    @Override
    public void init(ServletConfig config) throws ServletException {

    }

    @Override
    public ServletConfig getServletConfig() {
        return null;
    }

    @Override
    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
        System.out.println("servlet......");
        PrintWriter writer = res.getWriter();
        writer.write("success...");
//        writer.close();
    }

    @Override
    public String getServletInfo() {
        return null;
    }

    @Override
    public void destroy() {

    }
}
